import { defineStore } from 'pinia'

export const orderStore = defineStore('orderStore', {
    state: () => {
        return {
            order: '',
        }
    },
    actions: {
        setOrder(order) {
            this.order = order
        },
        getOrder() {
            return this.order
        },
    },
    persist: {
        // 开启数据持久化
        enabled: true,
        strategies: [
            {
                // 保存的名称
                key: 'order',
                storage: localStorage,
            },
        ],
    },
})
